/**
 * Copyright 2015-现在
 */
package com.bi.onlineEducation.utils;

import javax.persistence.Column;

public enum ResultEnum {
    // 成功
    SUCCESS(200, "成功"),

    // token异常
    TOKEN_PAST(301, "token过期"),
    TOKEN_ERROR(302, "token异常"),
    // 登录异常
    LOGIN_ERROR(303, "登录异常"),
    REMOTE_ERROR(304, "异地登录"),

    MENU_PAST(305, "菜单过期"),
    MENU_NO(306, "没此权限，请联系管理员！"),

    // 课程异常，4开头
    COURSE_SAVE_FAIL(403, "添加失败"),

    // 5开头,业务处理异常
    ADDRESS_ANALYSIS_ERROR(500, "地址解析异常：未知"),

    USER_LECTURER_AUDIT(507, "审核失败"),
    USER_SEND_FAIL(508, "发送失败"),
    USER_DELETE_FAIL(509, "删除失败"),

    // 系統异常，6开头
    SYSTEM_SAVE_FAIL(601, "添加失败"),
    SYSTEM_UPDATE_FAIL(602, "更新失败"),
    SYSTEM_DELETE_FAIL(603, "删除失败"),


    // 错误
    ERROR(999, "错误");

    private Integer code;

    @Column(name = "`desc`")
    private String desc;

    ResultEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    ResultEnum() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
